import martial.arts.tracker.*

class BootStrap {

    def init = { servletContext ->
        new MaClass(name: "Taekwando", dayOfWeek: "t,w", time: new Date()).save()
        new MaClass(name: "Judo", dayOfWeek: "m,w,f", time: new Date()).save()


        def b1 = new Belt(color: "blue", testTimeInMonths: 30).save()
        def b2 = new Belt(color: "brown", testTimeInMonths: 30).save()
        new Belt(color: "black", testTimeInMonths: 45).save()
        new Belt(color: "brown", testTimeInMonths: 60).save()

        def pr1 = new PaymentRule(name: "new student", amountPaid: 165, numberOfMonthsPaid: 3).save()
        def pr2 = new PaymentRule(name: "uniform", amountPaid: 40, numberOfMonthsPaid: 0).save()
        new PaymentRule(name: "belt", amountPaid: 5, numberOfMonthsPaid: 0).save()

        def account1 = new Account(accountId: 1, lastName: "thompson", firstName: "joshua", street: "200 Bridle Path", city: "billings", state: "mt", zip: 59105, email: "joshbthomp@gmail.com").save()
        def account2 = new Account(accountId: 2, lastName: "smith", firstName: "john", street: "123 east street", city: "bozeman", state: "md", zip: 20852, email: "happy@no.com").save()


        new Student(studentId: 12, lastName: "thompson", firstName: "brat", belt: b1, dob: new Date(), lastBeltTestDate: new Date(), email: "dummy.email@no.com", account: account1).save()
        new Student(studentId: 13, lastName: "thompson", firstName: "ed", belt: b2, dob: new Date(), lastBeltTestDate: new Date(), email: "dummy.email@no.com", account: account2).save()
        new Student(studentId: 16, lastName: "sales", firstName: "walt", belt: b1, dob: new Date(), lastBeltTestDate: new Date(), email: "new.email@heck.com", account: account1).save()

        new Payment(paid: false, dueDate: new Date(), paymentRule: pr1, account: account1).save()
        new Payment(paid: false, dueDate: new Date(), paymentRule: pr2, account: account1).save()

    }
    def destroy = {}
}
